Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's my attempt to fix #3.
Pros
callback
parameter is provided (and defaults to'callback'
when no value is specified) orapplication/javascript
is usedCons
media_type
is now set toapplication/json
fromJSONRenderer
(and therefore, ifcallback
is provided without explicitly requesting the properapplication/javascript
content type, it will respond withapplication/json
)There's another solution from the docs that demonstrates how to use multiple renderers (based on accepted media type). That method would allow you to use
application/javascript
again to eliminate the above con, but if you're manually doing that, you may as well manually wrap your json too without this plugin. Because you want to cut down on verbosity, the pros may outweigh the con.Also, Chrome didn't complain when I tried
<script src="myendpoint?callback=mycallback">
. And jQuery uses the right media type when using JSONP, so no issue there.Thoughts?